﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using sexhealth.console.service.post;
using sexhealth.console.service.post.vo;
using System.Text;
using sexhealth.console.service.common.vo;
using sexhealth.console.service.activity.vo;


public partial class index : System.Web.UI.Page
{
    PostService postService = new PostService();
    public string imgShow = string.Empty;
    int channelId = 12;
    protected void Page_Load(object sender, EventArgs e)
    {
        //首頁先暫時導入活動網頁
        if (DateTime.Today <= DateTime.Parse("2012/10/22"))
        {
            Response.Redirect("Activity.aspx");
        }

        if (!IsPostBack)
        {
            IList<PostVO> postList = postService.GetPostList(channelId);
            if (postList.Count > 0)
            {
                imgShow = Server.MapPath("~\\") + "\\upload\\media\\" + postList[0].FileLink;
            }
            else
            {
                imgShow = "image/show.jpg";
            }
            
        }
    }
}
